Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix update crash after code cleanup #67

Merged
merged 2 commits into from
Nov 9, 2023
Merged

Fix update crash after code cleanup #67

merged 2 commits into from
Nov 9, 2023

Conversation

dutow
Copy link
Collaborator

@dutow dutow commented Nov 8, 2023

Issue: the code cleanup introduced in PR #52 modified the original tuple in the update method instead of decrypting the tuple data into a copy. This caused data curruption crashes in some test.

Fix: reintroduce the missing palloc to the update method.

Fixes #61
Fixes #62
Fixes #64

Issue: the code cleanup introduced in PR percona#52 modified the original
tuple in the update method instead of decrypting the tuple data
into a copy. This caused data curruption crashes in some test.

Fix: reintroduce the missing palloc to the update method.

Fixes percona#62
Fixes percona#64
Copy link
Member

@dAdAbird dAdAbird left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM
It also fixes #61 issues with aborted transactions with updates. I can create a PR with regressions tests for those after merging this PR

src/access/pg_tdeam.c Outdated Show resolved Hide resolved
Co-authored-by: Andrew Pogrebnoi <[email protected]>
@dutow dutow merged commit 2b7ecbe into percona:main Nov 9, 2023
4 checks passed
@dutow dutow deleted the crashfix3 branch November 9, 2023 13:12
@codeforall
Copy link
Collaborator

This PR broke the Update statements.
#68

dutow added a commit to dutow/postgres-tde-ext that referenced this pull request Nov 13, 2023
Issue: with the fix in percona#67, pgtde decrypts tuples during update into
a new memory region, and changes the t_data pointer to this new region.

Because of this, later updates to tuple flags also happen in the new
data, and the original persisted tuple flags are never updated.

Fix: after the update statement is done with the decrypted data,
restore the t_data pointer to the original. This way, flag changes
happen where they should.

Fixes percona#68
dutow added a commit to dutow/postgres-tde-ext that referenced this pull request Nov 13, 2023
Issue: with the fix in percona#67, pgtde decrypts tuples during update into
a new memory region, and changes the t_data pointer to this new region.

Because of this, later updates to tuple flags also happen in the new
data, and the original persisted tuple flags are never updated.

Fix: after the update statement is done with the decrypted data,
restore the t_data pointer to the original. This way, flag changes
happen where they should.

Fixes percona#68
dutow added a commit that referenced this pull request Nov 15, 2023
Issue: with the fix in #67, pgtde decrypts tuples during update into
a new memory region, and changes the t_data pointer to this new region.

Because of this, later updates to tuple flags also happen in the new
data, and the original persisted tuple flags are never updated.

Fix: after the update statement is done with the decrypted data,
restore the t_data pointer to the original. This way, flag changes
happen where they should.

Fixes #68
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants